export function mapToObject(map){
    const object = {};
    map.forEach((key, value) => {
        object[value] = key;
    });
    return object;
}

export function mapToJson(map){
    let object = mapToObject(map);
    return JSON.stringify(object);
}

export function objectToMap(object){
    let map = new Map();
    Object.entries(object).forEach(([key, value]) => {
        map.set(key, value);
    });
    return map;
}

export function jsonToMap(json){
    let object = JSON.parse(json);
    return objectToMap(object)
}